Skip to content

feat: add R 4.5.x default runtime image and configurable additionalRuntimeImages#72

Merged
ian-flores merged 3 commits intomainfrom
feat-additional-runtime-images
Feb 9, 2026
Merged

feat: add R 4.5.x default runtime image and configurable additionalRuntimeImages#72
ian-flores merged 3 commits intomainfrom
feat-additional-runtime-images

Conversation

@ian-flores
Copy link
Contributor

Summary

  • Adds R 4.5.2 (Python 3.13.9, Quarto 1.8.25, Ubuntu 22.04) to the default off-host execution runtime images, resolving the "Cannot find compatible environment" error for R 4.5.x users
  • Introduces additionalRuntimeImages field on both Site and Connect specs, allowing operators to extend runtime images without an operator code change and release
  • Additional images are appended after the built-in defaults when building the runtime.yaml ConfigMap

Example Site YAML usage

spec:
  connect:
    additionalRuntimeImages:
      - rVersion: "4.6.0"
        pyVersion: "3.14.0"
        osVersion: "ubuntu2204"
        quartoVersion: "1.9.0"
        # repo defaults to ghcr.io/rstudio/content-pro if omitted

Files changed

File Change
api/core/v1beta1/connect_types.go New ConnectRuntimeImageSpec struct, AdditionalRuntimeImages on ConnectSpec, R 4.5.2 default, appending logic in DefaultRuntimeYAML()
api/core/v1beta1/site_types.go AdditionalRuntimeImages on InternalConnectSpec
internal/controller/core/site_controller_connect.go Cascade field from Site → Connect
api/core/v1beta1/connect_types_test.go Updated default count, tests for additional images and default repo
Generated (8 files) CRDs, deep copy, client-go apply configs, Helm chart CRDs

Test plan

  • Unit tests pass for default runtime YAML with 3 images
  • Unit tests pass for additional images appended after defaults
  • Unit tests pass for default repo when repo field omitted
  • Deploy to test cluster and verify runtime.yaml ConfigMap contains all expected images
  • Verify existing deployments without additionalRuntimeImages are unaffected

Closes #71

…ntimeImages

Adds R 4.5.2 (Python 3.13.9, Quarto 1.8.25) to the default off-host
execution runtime images. Introduces additionalRuntimeImages field on
Site and Connect specs so operators can extend runtime images without
requiring an operator release.

Closes #71
@claude
Copy link

claude bot commented Feb 6, 2026

Claude finished @ian-flores's task —— View job


PR #72 Review Complete

Summary

Overall this is a well-structured PR that adds a useful feature allowing operators to extend runtime images without requiring an operator release. The implementation follows existing patterns in the codebase.


API Changes (api/core/v1beta1/connect_types.go)

Checklist:

  • Kubebuilder annotations are correct (default annotation on Repo field)
  • New fields have sensible defaults (Repo defaults to ghcr.io/rstudio/content-pro)
  • Validation rules are present

Suggestions:

  1. Extract duplicated constant: The default repo "ghcr.io/rstudio/content-pro" is duplicated in three places:

    • Kubebuilder annotation (line 34)
    • ToProductDefinition() fallback (line 43)
    • Hardcoded image definitions in DefaultRuntimeYAML() (lines 278, 285, 292)

    Consider extracting to a package-level constant:

    const DefaultRuntimeImageRepo = "ghcr.io/rstudio/content-pro"
  2. Add validation markers: The CRD marks version fields as required, but consider adding MinLength=1 validation to prevent empty strings that would result in malformed image tags:

    // +kubebuilder:validation:MinLength=1
    RVersion string `json:"rVersion"`

Controller Changes (internal/controller/core/site_controller_connect.go)

Checklist:

  • Config flows from Site -> Product correctly
  • Field placement follows existing patterns for cascading from InternalConnectSpec to ConnectSpec

Tests (api/core/v1beta1/connect_types_test.go)

Good test coverage:

  • Default runtime count updated to 3 images
  • Additional images appended after defaults
  • Default repo fallback when Repo field omitted

Suggestion: Consider adding a test for error handling when GenerateImageEntry() fails for an additional image (e.g., if that method validates inputs).


Generated Files

CRDs, deepcopy, and client-go files are properly regenerated and consistent with the API changes.


Minor Observations

The R 4.5.2 default image is added at the beginning of the defaults array (connect_types.go:273-279), which seems intentional to make it the first/preferred match. This ordering is reasonable.


- Extract DefaultRuntimeImageRepo constant to replace duplicated repo string
- Add MinLength=1 kubebuilder validation on version fields to prevent
  empty strings that would produce malformed image tags
- Add test for error handling when an additional image has missing fields
- Fix gofmt alignment in site_controller_connect.go
- Regenerate CRDs and Helm chart
@ian-flores ian-flores marked this pull request as ready for review February 6, 2026 19:49
Copy link

@Lytol Lytol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, seems like a great addition!

One thought: this only gives us the ability to add additional default content images, but it doesn't let us override or remove the hard-coded ones. It could be useful to just set all the images explicitly, and then fall back to sensible defaults if none are specified. What do you think?

@ian-flores
Copy link
Contributor Author

Great point — created #74 to track adding full override support for default runtime images. Shipping the additive model in this PR and will address override capability as a follow-up.

@ian-flores ian-flores merged commit 1c39720 into main Feb 9, 2026
3 checks passed
@ian-flores ian-flores deleted the feat-additional-runtime-images branch February 9, 2026 16:02
ian-flores pushed a commit that referenced this pull request Feb 9, 2026
# [1.7.0](v1.6.0...v1.7.0) (2026-02-09)

### Features

* add R 4.5.x default runtime image and configurable additionalRuntimeImages ([#72](#72)) ([1c39720](1c39720))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add R 4.5.x default runtime image and make runtime images configurable via Site spec

2 participants